package com.codecrane.core.util;

/**
 * 获取货币简称
 */
public enum CountryCurrencyEnum {
    US(1, "USD"),
    UK(2, "GBP"),
    DE(3, "EUR"),
    FR(4, "EUR"),
    IT(5, "EUR"),
    ES(6, "EUR"),
    EU(7, "EUR"),
    JP(8, "JPY"),
    CA(9, "CAD"),
    CN(10,"CNY"),
    PK(11,"USD"),
    PKUS(13,"USD"),
    PKUK(14,"GBP"),
    PKDE(15,"EUR");


    private int code;
    private String msg;

    CountryCurrencyEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }


    /**
     * 根据充值类型获取充值的天数
     */
    public static String getCountry(int code) {
        for (CountryCurrencyEnum countryEnum : CountryCurrencyEnum.values()) {
            if (code == countryEnum.getCode()) {
                return countryEnum.getMsg();
            }
        }
        return "";
    }
}
